<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <f:facet name="first">
            <meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
            <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
            <title>Báo cáo sản lượng dịch vụ</title>
        </f:facet>
        <link type="text/css" rel="stylesheet" href="../css/main.css" />
        <style type="text/css">
            .ui-layout-north {
                z-index:20 !important;
                overflow:visible !important;;
            }

            .ui-layout-north .ui-layout-unit-content {
                overflow:visible !important;
            }
        </style>
        <style type="text/css">
            .ui-widget{font-size:95% !important;}
            .ui-layout-unit-content{background-color: #E5E5E5;border-width: 0px} 
            .ui-widget{border-width: 0px;color: red}
        </style>
    </h:head>
    <h:body>
        <div align="center" id="bodyForm">            
            <div style="width: 100%;">
                <p:layoutUnit id="top" position="north" size="auto">
                    <ui:insert name="menu">
                        <ui:include src="../../templates/menu.xhtml"/>
                    </ui:insert>
                </p:layoutUnit>

                <p:layoutUnit id="center" position="center" size="400">
                    <br/>
                    <h:outputText value="Báo cáo sản lượng dịch vụ" style="font-size: 30px;"/>
                    <h:form id="form">
                        <p:dialog modal="true" widgetVar="statusDialog" header="Đang tìm kiếm.."   
                                  draggable="false" closable="false">  
                            <p:graphicImage value="../../images/ajax-loader.gif" />  
                        </p:dialog>
                        <p:growl id="messages2"/>
                        <p:panelGrid columns="4">
                            <h:outputText value="Từ ngày: "/> <p:calendar pattern="dd-MM-yyyy" showOn="button" value="#{baocaoSLDVController.tuNgay}"/>
                            <h:outputText value="Đến ngày: "/> <p:calendar pattern="dd-MM-yyyy" showOn="button" value="#{baocaoSLDVController.denNgay}"/>
                            <h:outputText value="Đối tác: "/>
                            <p:selectOneMenu style="float: left;width: 176px;" value="#{baocaoSLDVController.doitac}">
                                <f:selectItems value="#{baocaoSLDVController.listDoitac}" var="dt" itemLabel="#{dt.name}" itemValue="#{dt.id}"/>  
                            </p:selectOneMenu>                                                 
                            <h:outputText value="Sản phẩm: "/>
                            <p:selectOneMenu style="float: left;width: 176px;" value="#{baocaoSLDVController.dichvu}">                              
                                <f:selectItem itemLabel="Tất cả" itemValue=""/>
                                <f:selectItems value="#{baocaoSLDVController.listDichvu}" var="dv" itemLabel="#{dv.name}" itemValue="#{dv.id}"/>  
                            </p:selectOneMenu>                                                 
                        </p:panelGrid>

                        <p:selectManyCheckbox value="#{baocaoSLDVController.chitietTheoNgay}">  
                            <f:selectItem itemLabel="Chi tiết theo ngày" itemValue="dd" />  
                        </p:selectManyCheckbox>                          
                        <p:commandButton value="Thống kê" action="#{baocaoSLDVController.thongke()}" update=":form" onclick="statusDialog.show();" oncomplete="statusDialog.hide();"/>
                        <p:dataTable value="#{baocaoSLDVController.lazyDataModel}" var="c" paginator="true" rows="20"
                                     rowsPerPageTemplate="20,25,30" paginatorPosition="bottom" lazy="true">
                            <p:column headerText="Ngày">
                                <h:outputText value="#{c.ngay}" style="float: right;"/>
                            </p:column>
                            <p:column headerText="Sản phẩm">
                                <h:outputText value="#{c.dichvu}" style="float: right;"/>
                            </p:column>
                            <p:column headerText="Số đăng kí">
                                <h:outputText value="#{c.SLDangKi}" style="float: right;"/>
                            </p:column>
                            <p:column headerText="Số hủy">
                                <h:outputText value="#{c.SLHuy}" style="float: right;"/>
                            </p:column>
                            <p:column headerText="Số hoạt động">
                                <h:outputText value="#{c.SLDangKi - c.SLHuy}" style="float: right;"/>
                            </p:column>
                        </p:dataTable>
                    </h:form>
                </p:layoutUnit>
                <p:layoutUnit id="bottom" position="bottom" size="60">
                    <ui:insert name="footer">
                        <ui:include src="../../templates/footer.xhtml"/>
                    </ui:insert>
                </p:layoutUnit>
            </div>
        </div>
    </h:body>
</html>

